home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / Apple Powerbook.CCL < prev    next >
Encoding:
Text File  |  1992-09-18  |  20.3 KB  |  634 lines  |  [TEXT/MPS ]

  1. !
  2. ! Apple Powerbook Internal Modem 2400 CCL script (Hardware MNP)
  3. !
  4. !    Change History-
  5. !        v1.0a1        1/15/92    gs:Created CCL
  6. !
  7. !    The following label ranges (0-255) are defined for all scripts:
  8. !
  9. !    Label        Function
  10. !    -----        --------
  11. !    0-19        Communications Setup
  12. !    20-39        Get a Modem (IBX switch thru)
  13. !    40-59        Modem Setup
  14. !    60-79        Dialing
  15. !    80-99        Physical Connection
  16. !    100-119        GEIS Logon
  17. !    120-139        CICS
  18. !    140-159        APPM
  19. !    160-179        Online
  20. !    180-199        Terminate Session
  21. !    200-209        Cancel
  22. !    210-219        Hangup
  23. !    230-239        <UNUSED>
  24. !    240-255        Disconnect
  25. !
  26. !    Note:        Label 210 is the modem hangup sequence
  27. !                Label 240 is reserved as the start of the disconnect sequence
  28. !
  29. !================================================================================
  30. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  31. !================================================================================
  32. !
  33. !    Set the Baud, Data, Stop, and Parity bits
  34. SerReset ~Baud ~Prty ~Xbts ~Sbts
  35. CTBParameter Port "~MPrt" 13
  36. !
  37. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  38. CTBOpen 14 15        ! Open the Communications session
  39. !
  40. !    Flush any data, Initialize script variables and define Cancel label
  41. Flush                ! clear input buffer and ring buffer
  42. CanBtn 200            ! If user cancels, take the error return
  43. !
  44. SetVar 1 0            ! #of consecutive no responses to hangup command
  45. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  46. SetVar 3 0            ! #of consecutive network contact failures.
  47. SetVar 4 0            ! #of logon validation failures
  48. SetVar 5 0            ! #of consecutive CICS90  failures
  49. SetVar 6 0            ! #of consecutive APPM failures
  50. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  51. SetVar 8 0            ! not used
  52. !
  53. Jump 20                ! Go to Modem Selection and Setup
  54. !
  55. !*********
  56. -LABEL 13    !---<CTBParameter Port failed>---
  57. !*********
  58. Alert -1 CTBParameter Port caused an error.
  59. Exit -1                ! exit the script with an error.
  60. !
  61. !*********
  62. -LABEL 14    !---<CTBOpen failed>---
  63. !*********
  64. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  65. Exit -1                ! exit the script with an error.
  66. !
  67. !**********
  68. -LABEL 15    !---<CTBOpen err>---
  69. !**********
  70. Alert -1 CTBOpen caused an Communications Toolbox error.
  71. Exit -1                ! exit the script with an error.
  72. !
  73. !================================================================================
  74. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  75. !================================================================================
  76. !
  77. !================================================================================
  78. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  79. !================================================================================
  80. DsplyPic 1
  81. DsplyMsg Making sure the Powerbook's internal modem is ready.
  82. Jsr 210                ! Hang up (just in case)
  83. SetVar 1 0            ! clear # hangup tries counter
  84. !
  85. !**********
  86. -LABEL 42    ! ---<Got modem attention>---
  87. !**********
  88. DsplyMsg Setting modem parameters.
  89. !    Clear all previous MatchStr's and setup the modem
  90. MatchStr 1 42 Dummy
  91. Wait 30                ! Give modem .5 second to get ready before sending the attention chars
  92. !    Send Apple Powerbook modem specific commands
  93. Xmit ATV1\V1X4&C1&L0&D2\92N2\13
  94. ! V1 - "verbal result messages"
  95. ! X4 - "wait for dial tone and detect busy"
  96. ! C1 - "CD on only if carrier detected & protocol established”
  97. ! L0 - "switched line"
  98. ! D2 - "drops phone line if DTR drops"
  99. ! N2 - "MNP reliable only connection"
  100. !
  101. !    Look for one of the following expected responses
  102. MatchStr 1 60 OK
  103. Wait 180               ! wait 3 secs
  104. IncVar 2            ! increment # modem setup tries
  105. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  106. DsplyMsg Modem does not respond to setup commands. Retrying ...
  107. Jump 42                ! else try modem setup again
  108. !
  109. !**********
  110. -LABEL 44    ! ---<Modem configuration err>---
  111. !**********
  112. Bell
  113. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  114. SetVar 2 0            ! clear # modem setup tries
  115. Jump 40                ! reset modem and try again
  116. !
  117. !================================================================================
  118. -LABEL 60    !***<Modem ready>*** Dial phone
  119. !================================================================================
  120. DsplyMsg Dialing ~Fone ...
  121. DsplyPic 2
  122. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  123. MatchStr 1 60 Dummy
  124. SetVar 2 0            ! clear #modem setup tries
  125. !    Turn off Xon/Xoff flow control
  126. CTBParameter Handshake XON/XOFF 78
  127. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  128. Xmit AT
  129. Wait 3                ! Pause before "tone dial" command
  130. Xmit D~Tone
  131. Wait 3                ! Pause before phone number
  132. Xmit ~Fone
  133. Wait 3
  134. Flush                ! clear input buffer and send CR
  135. Xmit \13
  136. !
  137. !    Look for one of the following expected responses
  138. MatchStr 1 80 CONNECT ~Baud\13
  139. MatchStr 2 66 CARRIER
  140. MatchStr 3 70 BUSY
  141. MatchStr 4 74 NO DIAL
  142. MatchStr 5 62 ERROR
  143. Wait 2100            ! wait 35 secs
  144. !
  145. !**********
  146. -LABEL 62    !---<No response or ERROR from modem>---
  147. !**********
  148. IncVar 3            ! Increment # dial attempts counter
  149. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  150. DsplyMsg Modem does not respond to Dial command. Retrying ...
  151. Jump 40                ! reset modem and try again
  152. !
  153. !**********
  154. -LABEL 64    !---<No dial response err>---
  155. !**********
  156. Bell
  157. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  158. SetVar 3 0            ! clear # dial attempts counter
  159. Jump 40                ! reset modem and try again
  160. !
  161. !**********
  162. -LABEL 66   !---<No Carrier>---
  163. !**********
  164. IncVar 3            ! Increment # dial attempts counter
  165. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  166. DsplyMsg No Carrier with phone number dialed. Retrying ...
  167. Jump 40                ! reset modem and try again
  168. !
  169. !**********
  170. -LABEL 68    !---<No carrier err>---
  171. !**********
  172. Bell
  173. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  174. SetVar 3 0            ! clear # dial attempts counter
  175. Jump 40                ! reset modem and try again
  176. !
  177. !**********
  178. -LABEL 70    !---<busy>---
  179. !**********
  180. IncVar 3            ! Increment # dial attempts counter
  181. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  182. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  183. Wait 300            ! wait 5 secs
  184. DsplyMsg Phone number dialed is busy. Retrying ....
  185. Jump 40                ! reset modem and try again
  186. !
  187. !**********
  188. -LABEL 72    !---<Busy err>---
  189. !**********
  190. Bell
  191. Alert 200 All network access lines are in use.\13Try again later.
  192. SetVar 3 0            ! clear # dial attempts counter
  193. Jump 40                ! reset modem and try again
  194. !
  195. !**********
  196. -LABEL 74    !---<No Dialtone>---
  197. !**********
  198. IncVar 3            ! Increment # dial attempts counter
  199. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  200. DsplyMsg Modem reports no dial tone. Retrying ...
  201. Jump 40                ! reset modem and try again
  202. !
  203. !**********
  204. -LABEL 76   !---<No dialtone Error>---
  205. !**********
  206. Bell
  207. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  208. SetVar 3 0            ! clear # dial attempts counter
  209. Jump 40                ! reset modem and try again
  210. !
  211. !*********
  212. -LABEL 78    !---<CTBParameter XON/XOFF failed>---
  213. !*********
  214. Alert -1 CTBParameter XON/XOFF caused an error.
  215. Exit -1                ! exit the script with an error
  216. !
  217. !================================================================================
  218. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  219. !================================================================================
  220. DsplyMsg Requesting network attention
  221. !    Look for one of the following expected responses
  222. MatchStr 1 84 NO CARRIER
  223. MatchStr 2 100 U#
  224. Xmit HH
  225. Wait 600            ! Allow 10 seconds for the U# to show up
  226. IncVar 3            ! No U#, increment # dial attempts counter
  227. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  228. DsplyMsg Unable to get network attention. Retrying ...
  229. Jump 80                ! reset modem and try again
  230. !
  231. !**********
  232. -LABEL 82    !---<No U#>---
  233. !**********
  234. Bell
  235. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  236. SetVar 3 0            ! clear # dial attempts counter
  237. Jump 40                ! reset modem and try again
  238. !
  239. !**********
  240. -LABEL 84    !---<Line dropped>---
  241. !**********
  242. IncVar 3            ! Increment # dial attempts counter
  243. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  244. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  245. Jump 40                ! reset modem and try again
  246. !
  247. !**********
  248. -LABEL 86   !---<Line dropped Err>---
  249. !**********
  250. Bell
  251. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  252. SetVar 3 0            ! clear # dial attempts counter
  253. Jump 40                ! reset modem and try again
  254. !
  255. !================================================================================
  256. -LABEL 100    !***<GEIS logon>***
  257. !================================================================================
  258. !
  259. DsplyMsg Physical Connection established. Logging on to network ...
  260. DsplyPic 3
  261. SetVar 3 0            ! clear # dial attempts counter
  262. Wait 6                ! wait 0.1 sec
  263. Flush                ! clear input buffer
  264. !    Note: leave 2 spaces between ~Dist and ~Numb
  265. Xmit ~User,~Dist  ~Numb,~Ridn\13
  266. !
  267. !    Look for one of the following expected responses
  268. MatchStr 1 104 NO CARRIER
  269. MatchStr 2 106 DISCONNECTED
  270. MatchStr 3 120 ===>
  271. MatchStr 6 108 N FAULT,
  272. MatchStr 7 108 T FORMAT,
  273. MatchStr 8 110 L DENIED
  274. MatchStr 9 112 BUSY
  275. MatchStr 10 112 DOWN
  276. Wait 4200            ! wait up to 70 seconds for a response
  277. IncVar 4            ! Increment # logon attempts counter
  278. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  279. DsplyMsg No logon response from network. Retrying ...
  280. Jump 40                ! reset modem and try again
  281. !
  282. !*********
  283. -LABEL 102    !---<No Logon response>---
  284. !*********
  285. Bell
  286. Alert 200 No logon response from network.\13Try again.
  287. SetVar 4 0            ! clear # logon attempts counter
  288. Jump 40                ! reset modem and try again
  289. !
  290. !*********
  291. -LABEL 104    !---<Carrier dropped>---
  292. !*********
  293. IncVar 4            ! Increment # login attempts counter
  294. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  295. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  296. Jump 40                ! reset modem and try again
  297. !
  298. !*********
  299. -LABEL 105    !---<Carrier dropped Err>---
  300. !*********
  301. Bell
  302. Alert 200 Carrier signal dropped during network logon.\13Try again.
  303. SetVar 4 0            ! clear # logon attempts counter
  304. Jump 40                ! reset modem and try again
  305. !
  306. !*********
  307. -LABEL 106    !---<Session disconnected>---
  308. !*********
  309. IncVar 4            ! Increment # logon attempts counter
  310. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  311. DsplyMsg Network connection dropped during network logon. Retrying ...
  312. Jump 40                ! reset modem and try again
  313. !
  314. !*********
  315. -LABEL 107    !---<Session disconnected Err>---
  316. !*********
  317. Bell
  318. Alert 200 Network connection dropped during network logon.\13Try again.
  319. SetVar 4 0            ! clear # logon attempts counter
  320. Jump 40                ! reset modem and try again
  321. !
  322. !*********
  323. -LABEL 108    !---<Validation fault>---
  324. !*********
  325. IncVar 4            ! Increment # logon attempts counter
  326. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  327. DsplyMsg Network rejected your identification. Retrying ...
  328. Wait 60                ! wait 1 sec
  329. Jump 100            ! retry GEIS login (only case where we don't reset)
  330. !
  331. !*********
  332. -LABEL 109    !---<validation fault err>---
  333. !*********
  334. Bell
  335. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  336. SetVar 4 0            ! clear # logon attempts counter
  337. Jump 40                ! reset modem and try again
  338. !
  339. !*********
  340. -LABEL 110    !---<Denied by host>---
  341. !*********
  342. IncVar 4            ! Increment # logon attempts counter
  343. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  344. DsplyMsg Network host equipment problem detected. Retrying ...
  345. Jump 40                ! reset modem and try again
  346. !
  347. !*********
  348. -LABEL 111    !---<Denied by host err>---
  349. !*********
  350. Bell
  351. Alert 200 Network host equipment problem detected.\13Try again.
  352. SetVar 4 0            ! clear # logon attempts counter
  353. Jump 40                ! reset modem and try again
  354. !
  355. !*********
  356. -LABEL 112    !---<MARK3K access busy/down>---
  357. !*********
  358. IncVar 4            ! Increment # logon attempts counter
  359. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  360. DsplyMsg Network equipment busy/down. Retrying ...
  361. Jump 40                ! reset modem and try again
  362. !
  363. !*********
  364. -LABEL 113    !---<MARK3K access busy/down err>---
  365. !*********
  366. Bell
  367. Alert 200 Network equipment busy or down.\13Try again.
  368. SetVar 4 0            ! clear # logon attempts counter
  369. Jump 40                ! reset modem and try again
  370. !
  371. !================================================================================
  372. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  373. !================================================================================
  374. !
  375. DsplyMsg Requesting access to network subsystem ...
  376. DsplyPic 4
  377. Wait 6                ! wait 0.1 secs
  378. Flush                ! clear input buffer
  379. !
  380. Xmit ~CICS\13
  381. !    Look for one of the following expected responses
  382. MatchStr 3 140 READY
  383. !    To overcome a network problem, the following label was changed from 124 to 126
  384. !    MatchStr 4 124 T BOUND
  385. MatchStr 4 126 T BOUND
  386. MatchStr 5 126 UNRECOGN
  387. MatchStr 6 126 ===>
  388. Wait 3600            ! Allow 60 secs for the expected responses to show up
  389. IncVar 5            ! Timeout, so increment # CICS tries counter
  390. IfVar 5 2 122        ! if 3 tries, display No Response alert
  391. DsplyMsg No response to network subsystem request. Retrying ...
  392. Jump 40                ! reset modem and try again
  393. !
  394. !*********
  395. -LABEL 122    !---<No CICS err>---
  396. !*********
  397. Bell
  398. Alert 200 No response to network subsystem request.\13Try again.
  399. SetVar 5 0            ! clear # CICS tries counter
  400. Jump 40                ! reset modem and try again
  401. !
  402. !*********
  403. -LABEL 124    !---<Session not bound err>---
  404. !*********
  405. Bell
  406. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  407. Jump 200            ! jump to cancel routine
  408. !
  409. !*********
  410. -LABEL 126    !---<Invalid application>---
  411. !*********
  412. IncVar 5            ! Increment # CICS tries counter
  413. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  414. DsplyMsg Network subsystem request has been rejected. Retrying ...
  415. Wait 60                ! wait 1 sec
  416. Flush
  417. Jump 120            ! try to access CICS again
  418. !
  419. !*********
  420. -LABEL 127    !---<Invalid application err>---
  421. !*********
  422. Bell
  423. Alert 200 The network subsystem request has been rejected.\13Try again.
  424. SetVar 5 0            ! clear # CICS tries counter
  425. Flush
  426. Jump 40                ! reset modem and try again
  427. !
  428. !================================================================================
  429. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  430. !================================================================================
  431. !
  432. DsplyMsg Requesting access to distribution center ~Dist ...
  433. DsplyPic 5            ! Highlight box 5 on screen
  434. SetVar 5 0            ! clear # CICS tries counter
  435. !                    ! Send what needs to be sent
  436. Xmit ~Epgm~Dist\13
  437. !    Look for one of the following expected responses
  438. Wait 12                ! wait 0.2 secs
  439. Flush                ! clear input buffer
  440. !    Look for one of the following expected responses
  441. MatchStr 3 160 C100
  442. MatchStr 4 144 INVALID
  443. Wait 3600            ! Allow 60 secs for the expected responses to show up
  444. !
  445. IncVar 6            ! Timeout, so Increment # APPM tries counter
  446. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  447. DsplyMsg No response to distribution center access request. Retrying ...
  448. Jump 40                ! reset modem and try again
  449. !
  450. !*********
  451. -LABEL 142    !---<No transaction response>---
  452. !*********
  453. Bell
  454. Alert 200 No response to distribution center access.\13Try again.
  455. SetVar 6 0            ! reset # APPM tries counter
  456. Jump 40                ! reset modem and try again
  457. !
  458. !*********
  459. -LABEL 144    !---<Invalid transaction>---
  460. !*********
  461. IncVar 6            ! Increment # APPM tries counter
  462. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  463. DsplyMsg Distribution center access request rejected. Retrying ...
  464. Jump 40                ! reset modem and try again
  465. !
  466. !*********
  467. -LABEL 145    !---<Invalid transaction err>---
  468. !*********
  469. Bell
  470. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  471. SetVar 6 0            ! reset # APPM tries counter
  472. Jump 40                ! reset modem and try again
  473. !
  474. !================================================================================
  475. -LABEL 160    !***<Online>***
  476. !================================================================================
  477. !
  478. Wait 60                ! wait 1 sec
  479. DsplyMsg Accessing the distribution center ~Dist ...
  480. DsplyPic 6            ! Highlight box 6 on screen
  481. !    C9 = pass msg thru GE, 899 = Echo cmd
  482. Xmit C9899Ole\13
  483. !    Look for one of the following expected responses
  484. MatchStr 2 162 C5
  485. MatchStr 3 170 Ole\13
  486. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  487. !
  488. !*********
  489. -LABEL 162    !---<no luck this time>--- 
  490. !*********
  491. DsplyMsg Distribution center is not available ...
  492. Jsr 180                ! terminate session
  493. Bell
  494. Alert -1 Distribution center is not available.\13Please try again later.
  495. Jump 200            ! exit to Cancel routine
  496. !
  497. !*********
  498. -LABEL 170    !---<Success, we’re in, so exit>--- 
  499. !*********
  500. Wait 30                ! wait 0.5 secs
  501. Flush                ! clear input buffer
  502. Exit 0                ! exit the script normally
  503. !
  504. !================================================================================
  505. -LABEL 180-199    !***<Terminate Session>***
  506. !================================================================================
  507. !
  508. !*********
  509. -LABEL 180    !---<Terminate session>--- 
  510. !*********
  511. !    send Abnormal disconnect command
  512. Xmit C3\13
  513. !    Look for one of the following expected responses
  514. MatchStr 1 182 U#
  515. Wait 300            ! wait 5 secs
  516. Return
  517. !
  518. !*********
  519. -LABEL 182    !---<Say bye>---
  520. !*********
  521. Wait 6                ! wait 0.1 sec and sign off the network
  522. Xmit BYE\13
  523. Return
  524. !
  525. !================================================================================
  526. -LABEL 200    !***<Cancel Routine>***
  527. !================================================================================
  528. DsplyMsg Canceling ...
  529. Flush
  530. Wait 30                ! wait 0.5 secs
  531. Exit -1                ! exit the script with an error
  532. !
  533. !================================================================================
  534. -LABEL 210    !***<Hang up phone Routine>***
  535. !================================================================================
  536. !
  537. !    Look for one of the following expected responses
  538. MatchStr 1 222 CARRIER
  539. SetVar 1 0            ! clear # hangup tries counter
  540. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  541. !
  542. !*********
  543. -LABEL 220    !---<Hang up the phone subroutine>---
  544. !*********
  545. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  546. Xmit +
  547. Xmit +
  548. Xmit +
  549. Wait 60                ! wait 1 more sec (end guard time)
  550. Flush                ! clear input buffer and tell modem to hang up verbosely
  551. Xmit ATV1H\13
  552. !    Look for one of the following expected responses
  553. MatchStr 2 222 OK
  554. MatchStr 3 224 ERROR
  555. Wait 120            ! wait 2 secs
  556. Jump 224            ! test for error or no response            
  557. !
  558. !*********
  559. -LABEL 222    !---<Reset the modem>---
  560. !*********
  561. !
  562. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  563. !                      This aids in script debugging so we dont reset modem 1st time.
  564. Flush                ! Flush the buffer and send Hayes Reset Modem command
  565. Xmit ATZ\13
  566. !    Look for one of the following expected responses
  567. MatchStr 2 229 OK
  568. MatchStr 3 224 ERROR
  569. Wait 180            ! wait 3 secs
  570. !
  571. !*********
  572. -LABEL 224    !---<Error or just no response>---
  573. !*********
  574. IncVar 1            ! Increment # hangup tries counter
  575. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  576. Jump 220            ! try to hangup again
  577. !
  578. !*********
  579. -LABEL 225    !---<Error>---
  580. !*********
  581. IfVar 7 1 229        ! If disconnecting, just return.
  582. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  583. SetVar 1 0            ! clear # hangup tries counter
  584. Jump 220            ! try to hangup again
  585. !
  586. !*********
  587. -LABEL 229    !---<Return from the Hangup sequence>---
  588. !*********
  589. Wait 60                ! wait 1 sec
  590. Flush                ! clear input buffer
  591. Return
  592. !
  593. !================================================================================
  594. -LABEL 230-239    !***<UNUSED>***
  595. !================================================================================
  596. !
  597. !================================================================================
  598. -LABEL 240    !***<Disconnection Sequence>***
  599. !================================================================================
  600. !
  601. !    If the connection is closed, we cant hangup, so just exit
  602. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  603. CTBIFCLOSED 246
  604. !
  605. SetVar 7 1            ! We're disconnecting, so set the flag
  606. !    Look for one of the following expected responses
  607. MatchStr 1 242 U#
  608. MatchStr 2 244 NO CARRIER
  609. Wait 60                ! wait 1 sec
  610. Jump 244            ! and hang up the phone
  611. !
  612. !*********
  613. -LABEL 242    !---<Sign off the network>---
  614. !*********
  615. Xmit BYE\13
  616. Wait 120            ! wait 2 secs
  617. !
  618. !*********
  619. -LABEL 244    !---<Hang up the phone>---
  620. !*********
  621. SetVar 1 0            ! clear the # hangup tries counter
  622. Jsr 210                ! Execute the Hang-up subroutine
  623. !    No CTBClose here because the connection is closed externally from the script
  624. !    in case we exited the script with an error before completion.
  625. Flush                ! clear input buffer
  626. Exit 0                ! exit the script normally
  627. !
  628. !*********
  629. -LABEL 246    !---<Connection Was Closed>---
  630. !*********
  631. Flush                ! clear input buffer
  632. Exit 0                ! exit the script normally
  633. ###
  634.